Health NUG
Overview
The Health NUG handles damage, healing, death, and lives for actors that need health logic.
Use it for the player, enemies, hazards, destructible props, bosses, and test actors in the demo level.
Component
AC_Health
What The System Does
- Stores current health and max health
- Applies damage
- Applies healing
- Handles lives if enabled
- Resets health after a life is lost
- Broadcasts health changes for UI and mascot reactions
- Supports future damage type logic through physical materials
Quick Setup
Use this section to test health, damage, healing, and lives.
- Add
AC_Healthto the player character or test actor. - Set max health.
- Set current health to max health on BeginPlay.
- Enable lives if the actor should respawn after health reaches zero.
- Create a test hazard actor.
- On overlap, call
TakeDamage. - Press Play.
- Walk into the hazard and check that health changes.
Features
- Damage handling
- Healing
- Lives system
- Health percentage output
- Optional death behaviour
- UI-friendly health state values
Runtime Flow
- Actor receives damage from a hazard, enemy, projectile, or gameplay event.
AC_Healthsubtracts the damage amount.- The component clamps health between zero and max health.
- The component updates the health percentage.
- UI or mascot logic can react to the new health state.
- If health reaches zero, the component checks whether lives are enabled.
- If lives remain, one life is removed and health resets.
- If no lives remain, death logic runs.
Usage
Attach AC_Health to any actor that requires health logic.
Blueprint Tutorial
Goal
Create a health component that can take damage, heal, lose lives, and update UI.
Before You Start
Create or confirm these assets exist:
AC_Health- A player character or test actor
- A hazard actor for damage testing
- A UI widget if testing health display
Step 1, Add The Health Component
- Open the player character Blueprint.
- Add
AC_Healthas an Actor Component. - Set max health.
- Set current health to max health on BeginPlay.
- Enable lives if the actor should respawn after health reaches zero.
Step 2, Create The Take Damage Function
Inside AC_Health, create a function called TakeDamage.
Suggested inputs:
DamageAmount, FloatDamageCauser, Actor ReferenceDamageSource, Name or Gameplay Tag
Function flow:
- Check that damage amount is greater than zero.
- Subtract damage from current health.
- Clamp current health from zero to max health.
- Update health percent.
- Broadcast health changed.
- If health is zero, call the death or life lost check.
Step 3, Create The Heal Function
Inside AC_Health, create a function called Heal.
Suggested inputs:
HealAmount, FloatHealSource, Actor Reference
Function flow:
- Check that heal amount is greater than zero.
- Add heal amount to current health.
- Clamp current health from zero to max health.
- Update health percent.
- Broadcast health changed.
Step 4, Add Lives Logic
When health reaches zero:
- Check whether lives are enabled.
- Check whether lives remaining is greater than zero.
- Remove one life.
- Reset current health to max health if
ResetHealthOnLifeLostis true. - Broadcast lives changed.
- If no lives remain, call death logic.
Step 5, Test Damage With A Hazard
- Place a hazard actor in the level.
- Add an overlap box.
- On overlap, get the player health component.
- Call
TakeDamage. - Print current health to screen.
- Test until health reaches zero.
- Confirm lives and reset health work.
Physical Material Damage Plan
This section is reserved for the later damage and health polish pass.
Future setup:
- Use physical materials to define surface-based damage behaviour
- Let hazards or projectiles read hit physical material
- Map physical material to damage amount or damage type
- Document this setup on the website
- Document this setup in the in-game demo level
Photo Slots
Use these slots when adding screenshots to the documentation site.
Health Component On Player
Image slot: health component on player.
Take Damage Blueprint
Image slot: take damage Blueprint.
Lives Logic Blueprint
Image slot: lives logic Blueprint.
Health UI Runtime Test
Image slot: health UI runtime test.
Physical Material Damage Setup
Image slot: physical material damage setup.
Injected Blueprint Code Slots
Paste exported Unreal Blueprint node text into these blocks when the Blueprint is final.
AC_Health, Take Damage Function
Paste exported Blueprint node code here.
AC_Health, Heal Function
Paste exported Blueprint node code here.
AC_Health, Lives Lost Function
Paste exported Blueprint node code here.
Hazard Damage Test
Paste exported Blueprint node code here.
Physical Material Damage Logic
Paste exported Blueprint node code here.
Common Issues
Health Does Not Change
Check that the damage or heal function is being called.
Use a print string before and after TakeDamage or Heal.
Health Goes Below Zero
Check that current health is clamped between zero and max health.
Healing Goes Above Max Health
Check that the heal function also clamps current health.
Lives Do Not Decrease
Check that lives are enabled.
Also check that the lives check runs when current health reaches zero.
Health Does Not Reset After Life Loss
Check the ResetHealthOnLifeLost bool.
If it is false, the actor may lose a life but keep zero health.
UI Does Not Update
Check that the health changed dispatcher is firing before debugging the widget.
Mascot Does Not React To Health
Check that the mascot system is bound to the health changed event.
Also check that the health state enum or percentage is being passed correctly.
Extension Notes
- Add health state enum values such as Hidden, Low, Mid, and High for UI and mascot reactions
- Add dispatchers for health changed, death, and lives changed
- Add physical material support for damage and health logic
- Add save support if health or lives should persist
- Add designer-facing demo labels in the example level
Testing Checklist
- Damage reduces health
- Healing restores health
- Health never goes below zero
- Health never goes above max health
- Life is removed when health reaches zero
- Health resets after life loss when enabled
- Death logic runs when no lives remain
- UI updates when health changes
- Mascot can react to health percentage or health state
- Physical material damage logic is documented later